/**
 * Created by Eric_HSBC on 16-6-26.
 * 登录验证
 */

var express = require('express');
var router = express.Router();


function isAdminLogined(req) {
  return req.session.loginstatus;
}

router.all("/*", function (req, res, next) {
  if (isAdminLogined(req)) {
    next()
  } else {
    let obj={}
    obj.status='expired'
    obj.url=req.originalUrl
    res.send(obj)
  }
});


module.exports = router;
